﻿@{
    ViewBag.Title = "Login";
    Layout = "~/Views/_LayoutAdmin.cshtml";
}

<head>
    <title>后台登录</title>
    <link href="~/BootstrapSouce/css/bootstrap.min.css" rel="stylesheet" />
    <script src="~/BootstrapSouce/js/jquery.min.js"></script>
    <script src="~/BootstrapSouce/js/bootstrap.min.js"></script>
    <link href="~/CSS/Admin_Login.css" rel="stylesheet" />
</head>
<script>
    $(document).ready(function () {

    });
    function Login() {
        $.ajax({
            type: "get",
            url: "http://localhost:32132/api/Values/GetLogin",
            data: {
                "name": $("#adminname").val(),
                "pwd": $("#adminpassword").val()
            },
            success: function (d) {
                var p = jQuery.parseJSON(d);
              
                if (p != null) {
                    location.href = "/Admin/Index";

                }
                else {
                    alert("用户名或者密码错误");
                }
            }

        })

    }

</script>

<body>
    @*<table class="form-horizontal" role="form" id="Admin_Login_Form">

        </table><div class="form-group">*@
    <div id="Admin_Login_Form">
        <div class="col-sm-10">
            <input type="text" class="form-control" id="adminname" placeholder="请输入用户名">
        </div>
        <br /><br /><br />
        <div class="form-group">
            <div class="col-sm-10">
                <input type="password" class="form-control" id="adminpassword" placeholder="请输入密码">
            </div>
        </div>
        <br /><br /><br />
        <div class="col-sm-offset-2 col-sm-10">
            <button type="button" onclick="Login()" class="btn btn-default">&nbsp;&nbsp; 登&nbsp;录 &nbsp;&nbsp;</button>
        </div>
    </div>
    @*<form class="form-horizontal" role="form" id="Admin_Login_Form">

        </form>*@
</body>
